<template>
  <ul class="todo-main">
    <!-- 根据App传来的数据遍历生成对应的Item 并且把每一项数据批量传给对应的Item-->
    <Item v-for="todo in todoList" :key="todo.id" v-bind="todo" 
          :asignChange="asignChange" :asignDelete="asignDelete"
    />
  </ul>
</template>

<script>
import Item from "./Item"
export default {
  name: "List",
  //接收数据 
  props: ["todoList" , "asignChange" , "asignDelete"],
  components:{
    Item,
  },
};
</script>

<style scoped>
/*main*/
.todo-main {
  margin-left: 0px;
  border: 1px solid #ddd;
  border-radius: 2px;
  padding: 0px;
}

.todo-empty {
  height: 40px;
  line-height: 40px;
  border: 1px solid #ddd;
  border-radius: 2px;
  padding-left: 5px;
  margin-top: 10px;
}
</style>